﻿using Opc.Ua;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunicationCore.OpcUaClient
{
    public class DataTypeHelper
    {
        public static string DataTypeConvert(uint typeId)
        {
            switch (typeId)
            {
                case 1:
                    {
                        return BuiltInType.Boolean.ToString();
                    }
                case 2:
                    {
                        return BuiltInType.SByte.ToString();
                    }

                case 3:
                    {
                        return BuiltInType.Byte.ToString();
                    }

                case 4:
                    {
                        return BuiltInType.Int16.ToString();
                    }

                case 5:
                    {
                        return BuiltInType.UInt16.ToString();
                    }

                case 6:
                    {
                        return BuiltInType.Int32.ToString();
                    }

                case 7:
                    {
                        return BuiltInType.UInt32.ToString();
                    }

                case 8:
                    {
                        return BuiltInType.Int64.ToString();
                    }

                case 9:
                    {
                        return BuiltInType.UInt64.ToString();
                    }


                case 10:
                    {
                        return BuiltInType.Float.ToString();
                    }

                case 11:
                    {
                        return BuiltInType.Double.ToString();
                    }

                case 15:
                    {
                        return BuiltInType.ByteString.ToString();
                    }

                case 22:
                    {
                        return BuiltInType.ExtensionObject.ToString();
                    }

                case 23:
                    {
                        return BuiltInType.DataValue.ToString();
                    }

                case 25:
                    {
                        return BuiltInType.DiagnosticInfo.ToString();
                    }

                case 27:
                    {
                        return BuiltInType.Integer.ToString();
                    }

                case 28:
                    {
                        return BuiltInType.UInteger.ToString();
                    }

                case 29:
                    {
                        return BuiltInType.Enumeration.ToString();
                    }

                default:
                    {
                        return "UnDefine";
                    }



            }

        }
    }
}
